import _ from "lodash";
import db from "@/server/connector/db";
import { User } from "@prisma/client";
import log from "../log";
import AppError from "@/shared/app-error";

async function findByUsername(username: string): Promise<User | null> {
  return await db.user.findFirst({ where: { username } });
}

const userService = {
  findByUsername,
};

export default userService;
